package org.example.web3j.contracts;

import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.web3j.abi.EventEncoder;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Bytes32;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.abi.datatypes.generated.Uint32;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.BaseEventResponse;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tuples.generated.Tuple4;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 1.5.0.
 */
@SuppressWarnings("rawtypes")
public class CPAMM extends Contract {
    public static final String BINARY = "0x60c0604052601e600a55600a600b55348015610019575f5ffd5b50604051613bb9380380613bb9833981810160405281019061003b91906104a9565b60016002819055505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156100ab57505f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b6100ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100e190610553565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014f906105bb565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250506101d25f5f1b826102ec60201b60201c565b506102037fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775826102ec60201b60201c565b506102347f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef1826102ec60201b60201c565b506102657f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c826102ec60201b60201c565b5080600e5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f6005819055505f600681905550640100000000426102c5919061060f565b60095f6101000a81548163ffffffff021916908363ffffffff16021790555050505061063f565b5f6102fd83836103e160201b60201c565b6103d75760015f5f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555061037461044460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4600190506103db565b5f90505b92915050565b5f5f5f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b5f33905090565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6104788261044f565b9050919050565b6104888161046e565b8114610492575f5ffd5b50565b5f815190506104a38161047f565b92915050565b5f5f5f606084860312156104c0576104bf61044b565b5b5f6104cd86828701610495565b93505060206104de86828701610495565b92505060406104ef86828701610495565b9150509250925092565b5f82825260208201905092915050565b7f4350414d4d3a205a45524f5f41444452455353000000000000000000000000005f82015250565b5f61053d6013836104f9565b915061054882610509565b602082019050919050565b5f6020820190508181035f83015261056a81610531565b9050919050565b7f4350414d4d3a204944454e544943414c5f544f4b454e530000000000000000005f82015250565b5f6105a56017836104f9565b91506105b082610571565b602082019050919050565b5f6020820190508181035f8301526105d281610599565b9050919050565b5f819050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610619826105d9565b9150610624836105d9565b925082610634576106336105e2565b5b828206905092915050565b60805160a0516134db6106de5f395f8181610a1a01528181610b7901528181610ea401528181610f3f01528181610fb7015281816111b8015281816114c401528181611623015281816118000152611e9601525f8181610790015281816109c301528181610ab501528181610b2d01528181610e4d015281816110030152818161113c015281816115d6015281816117b50152611e2001526134db5ff3fe608060405234801561000f575f5ffd5b5060043610610225575f3560e01c806375b238fc1161012e578063bd9a548b116100b6578063d547741f1161007a578063d547741f14610612578063d73792a91461062e578063ded998b91461064c578063ed856cdc1461067e578063f9063ba1146106af57610225565b8063bd9a548b14610579578063c415b95c1461059a578063c5700a02146105b8578063cc5864ee146105d6578063d21220a7146105f457610225565b806393794d52116100fd57806393794d52146104e7578063a1af5b9a14610517578063a217fddf14610521578063a42dce801461053f578063b0e21e8a1461055b57610225565b806375b238fc14610473578063787dce3d146104915780638456cb59146104ad57806391d14854146104b757610225565b80633f4ba83a116101b157806354cf2aeb1161018057806354cf2aeb146103cb5780635a76f25e146103e95780635c975abb146104075780636a2a507b1461042557806370a082311461044357610225565b80633f4ba83a14610355578063443cb4bc1461035f57806347d792c51461037d57806353f1c8cc1461039b57610225565b806318160ddd116101f857806318160ddd146102b3578063248a9ca3146102d15780632f2ff15d1461030157806334e199071461031d57806336568abe1461033957610225565b806301ffc9a71461022957806305db2f411461025957806307e2cea5146102775780630dfe168114610295575b5f5ffd5b610243600480360381019061023e919061275e565b6106cd565b60405161025091906127a3565b60405180910390f35b610261610746565b60405161026e91906127d4565b60405180910390f35b61027f61076a565b60405161028c91906127d4565b60405180910390f35b61029d61078e565b6040516102aa919061282c565b60405180910390f35b6102bb6107b2565b6040516102c8919061285d565b60405180910390f35b6102eb60048036038101906102e691906128a0565b6107b8565b6040516102f891906127d4565b60405180910390f35b61031b600480360381019061031691906128f5565b6107d4565b005b6103376004803603810190610332919061295d565b6107f6565b005b610353600480360381019061034e91906128f5565b6108b0565b005b61035d61092b565b005b610367610960565b604051610374919061285d565b60405180910390f35b610385610966565b604051610392919061285d565b60405180910390f35b6103b560048036038101906103b09190612988565b61096c565b6040516103c2919061285d565b60405180910390f35b6103d3610c45565b6040516103e0919061285d565b60405180910390f35b6103f1610c4b565b6040516103fe919061285d565b60405180910390f35b61040f610c51565b60405161041c91906127a3565b60405180910390f35b61042d610c66565b60405161043a919061285d565b60405180910390f35b61045d600480360381019061045891906129ec565b610c6c565b60405161046a919061285d565b60405180910390f35b61047b610c81565b60405161048891906127d4565b60405180910390f35b6104ab60048036038101906104a6919061295d565b610ca5565b005b6104b5610d5e565b005b6104d160048036038101906104cc91906128f5565b610d93565b6040516104de91906127a3565b60405180910390f35b61050160048036038101906104fc9190612988565b610df6565b60405161050e919061285d565b60405180910390f35b61051f6110cf565b005b610529611202565b60405161053691906127d4565b60405180910390f35b610559600480360381019061055491906129ec565b611208565b005b610563611343565b604051610570919061285d565b60405180910390f35b610581611349565b6040516105919493929190612a17565b60405180910390f35b6105a2611482565b6040516105af919061282c565b60405180910390f35b6105c06114a7565b6040516105cd9190612a78565b60405180910390f35b6105de6114bc565b6040516105eb919061285d565b60405180910390f35b6105fc6114c2565b604051610609919061282c565b60405180910390f35b61062c600480360381019061062791906128f5565b6114e6565b005b610636611508565b604051610643919061285d565b60405180910390f35b61066660048036038101906106619190612a91565b61150e565b60405161067593929190612b1a565b60405180910390f35b61069860048036038101906106939190612b4f565b6116e6565b6040516106a6929190612bc6565b60405180910390f35b6106b76118ca565b6040516106c4919061285d565b60405180910390f35b5f7f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061073f575061073e826118d0565b5b9050919050565b7f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c81565b7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef181565b7f000000000000000000000000000000000000000000000000000000000000000081565b60035481565b5f5f5f8381526020019081526020015f20600101549050919050565b6107dd826107b8565b6107e681611939565b6107f0838361194d565b50505050565b7f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c61082081611939565b6103e8821115610865576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085c90612c47565b60405180910390fd5b5f600a54905082600a819055507f2add06f33981e1ffcda660767486d0cfefcac2c7e4434d844287357decd3a2fa81846040516108a3929190612bc6565b60405180910390a1505050565b6108b8611a36565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461091c576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109268282611a3d565b505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561095581611939565b61095d611b26565b50565b60055481565b600c5481565b5f610975611b87565b61097d611bcb565b81428110156109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b890612caf565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a6957507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b610aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9f90612d17565b60405180910390fd5b610ab0611c0c565b610ae07f000000000000000000000000000000000000000000000000000000000000000087600554600654611d25565b915084821015610b25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1c90612da5565b60405180910390fd5b610b723330887f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f23909392919063ffffffff16565b610bbd84837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611fa59092919063ffffffff16565b610bc9865f5f85612024565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822885f5f87604051610c2c9493929190612e05565b60405180910390a350610c3d6120af565b949350505050565b600a5481565b60065481565b5f60015f9054906101000a900460ff16905090565b600d5481565b6004602052805f5260405f205f915090505481565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b7f6c0757dc3e6b28b2580c03fd9e96c274acf4f99d91fbec9b418fa1d70604ff1c610ccf81611939565b6032821115610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a90612e92565b60405180910390fd5b5f600b54905082600b819055507ff0c1be0c0ddaaf66cf0d34537244ebf0a6599c0fb352f61c9b3b8e12406144718184604051610d51929190612bc6565b60405180910390a1505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610d8881611939565b610d906120b9565b50565b5f5f5f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b5f610dff611b87565b610e07611bcb565b8142811015610e4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4290612caf565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610ef357507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b610f32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2990612d17565b60405180910390fd5b610f3a611c0c565b610f6a7f000000000000000000000000000000000000000000000000000000000000000087600654600554611d25565b915084821015610faf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa690612da5565b60405180910390fd5b610ffc3330887f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f23909392919063ffffffff16565b61104784837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611fa59092919063ffffffff16565b6110535f87845f612024565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8225f89865f6040516110b69493929190612eb0565b60405180910390a3506110c76120af565b949350505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756110f981611939565b5f600c5490505f600d5490505f821115611181575f600c81905550611180600e5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611fa59092919063ffffffff16565b5b5f8111156111fd575f600d819055506111fc600e5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611fa59092919063ffffffff16565b5b505050565b5f5f1b81565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561123281611939565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036112a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129790612f3d565b60405180910390fd5b5f600e5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600e5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb0d05f50f6e5fd588cf59aaebd9bf1eabed6fb8664c21021cc1dc91508ff8d698184604051611336929190612f5b565b60405180910390a1505050565b600b5481565b5f5f5f5f5f6006541461137e57600654670de0b6b3a764000060055461136f9190612faf565b611379919061301d565b611380565b5f5b93505f600554146113b357600554670de0b6b3a76400006006546113a49190612faf565b6113ae919061301d565b6113b5565b5f5b92505f60095f9054906101000a900463ffffffff1663ffffffff16426113db919061304d565b90505f8163ffffffff161180156113f457505f60055414155b801561140257505f60065414155b15611470578063ffffffff168163ffffffff16866114209190612faf565b60075461142d9190613080565b611437919061301d565b92508063ffffffff168163ffffffff16856114529190612faf565b60085461145f9190613080565b611469919061301d565b915061147b565b600754925060085491505b5090919293565b600e5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095f9054906101000a900463ffffffff1681565b60085481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6114ef826107b8565b6114f881611939565b6115028383611a3d565b50505050565b61271081565b5f5f5f611519611b87565b611521611bcb565b8342811015611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155c90612caf565b60405180910390fd5b61156d611c0c565b6115778a8a61211a565b809350819450505087831015801561158f5750868210155b6115ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c590613123565b60405180910390fd5b61161b3330857f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f23909392919063ffffffff16565b6116683330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f23909392919063ffffffff16565b61167386848461218f565b935061168183835f5f612024565b3373ffffffffffffffffffffffffffffffffffffffff167f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f84846040516116c9929190612bc6565b60405180910390a2506116da6120af565b96509650969350505050565b5f5f6116f0611b87565b6116f8611bcb565b824281101561173c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173390612caf565b60405180910390fd5b611744611c0c565b61174d886122e0565b80935081945050508683101580156117655750858210155b6117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906131b1565b60405180910390fd5b6117ae3389612321565b6117f985847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611fa59092919063ffffffff16565b61184485837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611fa59092919063ffffffff16565b6118505f5f8585612024565b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d8193649685856040516118af929190612bc6565b60405180910390a3506118c06120af565b9550959350505050565b60075481565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61194a81611945611a36565b612405565b50565b5f6119588383610d93565b611a2c5760015f5f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506119c9611a36565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019050611a30565b5f90505b92915050565b5f33905090565b5f611a488383610d93565b15611b1c575f5f5f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550611ab9611a36565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a460019050611b20565b5f90505b92915050565b611b2e612456565b5f60015f6101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611b70611a36565b604051611b7d919061282c565b60405180910390a1565b6002805403611bc2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028081905550565b611bd3610c51565b15611c0a576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f64010000000042611c1e91906131cf565b90505f60095f9054906101000a900463ffffffff1682611c3e91906131ff565b90505f8163ffffffff16118015611c5757505f60055414155b8015611c6557505f60065414155b15611d01578063ffffffff16600554670de0b6b3a7640000600654611c8a9190612faf565b611c94919061301d565b611c9e9190612faf565b60075f828254611cae9190613080565b925050819055508063ffffffff16600654670de0b6b3a7640000600554611cd59190612faf565b611cdf919061301d565b611ce99190612faf565b60085f828254611cf99190613080565b925050819055505b8160095f6101000a81548163ffffffff021916908363ffffffff1602179055505050565b5f5f8411611d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5f90613280565b60405180910390fd5b5f83118015611d7657505f82115b611db5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dac906132e8565b60405180910390fd5b5f612710600a5486611dc79190612faf565b611dd1919061301d565b90505f8186611de0919061304d565b90505f6064600b5484611df39190612faf565b611dfd919061301d565b90505f811115611ef4578773ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1603611e7d5780600c54611e689190613080565b600c819055508082611e7a919061304d565b91505b8773ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1603611ef35780600d54611ede9190613080565b600d819055508082611ef0919061304d565b91505b5b8186611f009190613080565b8583611f0c9190612faf565b611f16919061301d565b9350505050949350505050565b611f9f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401611f5893929190613306565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612496565b50505050565b61201f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611fd892919061333b565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612496565b505050565b5f60055490505f600654905083868361203d9190613080565b612047919061304d565b60058190555082858261205a9190613080565b612064919061304d565b6006819055507fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a60055460065460405161209f929190612bc6565b60405180910390a1505050505050565b6001600281905550565b6120c1611bcb565b6001805f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612103611a36565b604051612110919061282c565b60405180910390a1565b5f5f5f6003540361213057839150829050612188565b5f600554600654866121429190612faf565b61214c919061301d565b905083811161216057849250809150612186565b5f600654600554866121729190612faf565b61217c919061301d565b9050809350849250505b505b9250929050565b5f5f600354036121b4576121ad82846121a89190612faf565b612531565b90506121f5565b6121f2600554600354856121c89190612faf565b6121d2919061301d565b600654600354856121e39190612faf565b6121ed919061301d565b6126cb565b90505b5f8111612237576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222e906133d2565b60405180910390fd5b8060045f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546122809190613080565b60045f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508060035f8282546122d29190613080565b925050819055509392505050565b5f5f600354600554846122f39190612faf565b6122fd919061301d565b9150600354600654846123109190612faf565b61231a919061301d565b9050915091565b5f8111612363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235a90613460565b60405180910390fd5b8060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546123ac919061304d565b60045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550806003546123fb919061304d565b6003819055505050565b61240f8282610d93565b6124525780826040517fe2517d3f00000000000000000000000000000000000000000000000000000000815260040161244992919061347e565b60405180910390fd5b5050565b61245e610c51565b612494576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f5f60205f8451602086015f885af1806124b5576040513d5f823e3d81fd5b3d92505f519150505f82146124ce5760018114156124e9565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561252b57836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401612522919061282c565b60405180910390fd5b50505050565b5f60018211612542578190506126c6565b5f8290505f60019050700100000000000000000000000000000000821061257257608082901c9150604081901b90505b68010000000000000000821061259157604082901c9150602081901b90505b64010000000082106125ac57602082901c9150601081901b90505b6201000082106125c557601082901c9150600881901b90505b61010082106125dd57600882901c9150600481901b90505b601082106125f457600482901c9150600281901b90505b6004821061260457600181901b90505b600181600302901c905060018185816126205761261f612ff0565b5b048201901c9050600181858161263957612638612ff0565b5b048201901c9050600181858161265257612651612ff0565b5b048201901c9050600181858161266b5761266a612ff0565b5b048201901c9050600181858161268457612683612ff0565b5b048201901c9050600181858161269d5761269c612ff0565b5b048201901c90506126bf8185816126b7576126b6612ff0565b5b0482116126e1565b8103925050505b919050565b5f6126d982841084846126ec565b905092915050565b5f8115159050919050565b5f6126f6846126e1565b82841802821890509392505050565b5f5ffd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61273d81612709565b8114612747575f5ffd5b50565b5f8135905061275881612734565b92915050565b5f6020828403121561277357612772612705565b5b5f6127808482850161274a565b91505092915050565b5f8115159050919050565b61279d81612789565b82525050565b5f6020820190506127b65f830184612794565b92915050565b5f819050919050565b6127ce816127bc565b82525050565b5f6020820190506127e75f8301846127c5565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f612816826127ed565b9050919050565b6128268161280c565b82525050565b5f60208201905061283f5f83018461281d565b92915050565b5f819050919050565b61285781612845565b82525050565b5f6020820190506128705f83018461284e565b92915050565b61287f816127bc565b8114612889575f5ffd5b50565b5f8135905061289a81612876565b92915050565b5f602082840312156128b5576128b4612705565b5b5f6128c28482850161288c565b91505092915050565b6128d48161280c565b81146128de575f5ffd5b50565b5f813590506128ef816128cb565b92915050565b5f5f6040838503121561290b5761290a612705565b5b5f6129188582860161288c565b9250506020612929858286016128e1565b9150509250929050565b61293c81612845565b8114612946575f5ffd5b50565b5f8135905061295781612933565b92915050565b5f6020828403121561297257612971612705565b5b5f61297f84828501612949565b91505092915050565b5f5f5f5f608085870312156129a05761299f612705565b5b5f6129ad87828801612949565b94505060206129be87828801612949565b93505060406129cf878288016128e1565b92505060606129e087828801612949565b91505092959194509250565b5f60208284031215612a0157612a00612705565b5b5f612a0e848285016128e1565b91505092915050565b5f608082019050612a2a5f83018761284e565b612a37602083018661284e565b612a44604083018561284e565b612a51606083018461284e565b95945050505050565b5f63ffffffff82169050919050565b612a7281612a5a565b82525050565b5f602082019050612a8b5f830184612a69565b92915050565b5f5f5f5f5f5f60c08789031215612aab57612aaa612705565b5b5f612ab889828a01612949565b9650506020612ac989828a01612949565b9550506040612ada89828a01612949565b9450506060612aeb89828a01612949565b9350506080612afc89828a016128e1565b92505060a0612b0d89828a01612949565b9150509295509295509295565b5f606082019050612b2d5f83018661284e565b612b3a602083018561284e565b612b47604083018461284e565b949350505050565b5f5f5f5f5f60a08688031215612b6857612b67612705565b5b5f612b7588828901612949565b9550506020612b8688828901612949565b9450506040612b9788828901612949565b9350506060612ba8888289016128e1565b9250506080612bb988828901612949565b9150509295509295909350565b5f604082019050612bd95f83018561284e565b612be6602083018461284e565b9392505050565b5f82825260208201905092915050565b7f4350414d4d3a204645455f544f4f5f48494748000000000000000000000000005f82015250565b5f612c31601383612bed565b9150612c3c82612bfd565b602082019050919050565b5f6020820190508181035f830152612c5e81612c25565b9050919050565b7f4350414d4d3a20455850495245440000000000000000000000000000000000005f82015250565b5f612c99600e83612bed565b9150612ca482612c65565b602082019050919050565b5f6020820190508181035f830152612cc681612c8d565b9050919050565b7f4350414d4d3a20494e56414c49445f544f0000000000000000000000000000005f82015250565b5f612d01601183612bed565b9150612d0c82612ccd565b602082019050919050565b5f6020820190508181035f830152612d2e81612cf5565b9050919050565b7f4350414d4d3a20494e53554646494349454e545f4f55545055545f414d4f554e5f8201527f5400000000000000000000000000000000000000000000000000000000000000602082015250565b5f612d8f602183612bed565b9150612d9a82612d35565b604082019050919050565b5f6020820190508181035f830152612dbc81612d83565b9050919050565b5f819050919050565b5f819050919050565b5f612def612dea612de584612dc3565b612dcc565b612845565b9050919050565b612dff81612dd5565b82525050565b5f608082019050612e185f83018761284e565b612e256020830186612df6565b612e326040830185612df6565b612e3f606083018461284e565b95945050505050565b7f4350414d4d3a2050524f544f434f4c5f4645455f544f4f5f48494748000000005f82015250565b5f612e7c601c83612bed565b9150612e8782612e48565b602082019050919050565b5f6020820190508181035f830152612ea981612e70565b9050919050565b5f608082019050612ec35f830187612df6565b612ed0602083018661284e565b612edd604083018561284e565b612eea6060830184612df6565b95945050505050565b7f4350414d4d3a205a45524f5f41444452455353000000000000000000000000005f82015250565b5f612f27601383612bed565b9150612f3282612ef3565b602082019050919050565b5f6020820190508181035f830152612f5481612f1b565b9050919050565b5f604082019050612f6e5f83018561281d565b612f7b602083018461281d565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612fb982612845565b9150612fc483612845565b9250828202612fd281612845565b91508282048414831517612fe957612fe8612f82565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61302782612845565b915061303283612845565b92508261304257613041612ff0565b5b828204905092915050565b5f61305782612845565b915061306283612845565b925082820390508181111561307a57613079612f82565b5b92915050565b5f61308a82612845565b915061309583612845565b92508282019050808211156130ad576130ac612f82565b5b92915050565b7f4350414d4d3a20494e53554646494349454e545f4c49515549444954595f50525f8201527f4f56494445440000000000000000000000000000000000000000000000000000602082015250565b5f61310d602683612bed565b9150613118826130b3565b604082019050919050565b5f6020820190508181035f83015261313a81613101565b9050919050565b7f4350414d4d3a20494e53554646494349454e545f4c49515549444954595f57495f8201527f5448445241574e00000000000000000000000000000000000000000000000000602082015250565b5f61319b602783612bed565b91506131a682613141565b604082019050919050565b5f6020820190508181035f8301526131c88161318f565b9050919050565b5f6131d982612845565b91506131e483612845565b9250826131f4576131f3612ff0565b5b828206905092915050565b5f61320982612a5a565b915061321483612a5a565b9250828203905063ffffffff8111156132305761322f612f82565b5b92915050565b7f4350414d4d3a20494e53554646494349454e545f494e5055545f414d4f554e545f82015250565b5f61326a602083612bed565b915061327582613236565b602082019050919050565b5f6020820190508181035f8301526132978161325e565b9050919050565b7f4350414d4d3a20494e53554646494349454e545f4c49515549444954590000005f82015250565b5f6132d2601d83612bed565b91506132dd8261329e565b602082019050919050565b5f6020820190508181035f8301526132ff816132c6565b9050919050565b5f6060820190506133195f83018661281d565b613326602083018561281d565b613333604083018461284e565b949350505050565b5f60408201905061334e5f83018561281d565b61335b602083018461284e565b9392505050565b7f4350414d4d3a20494e53554646494349454e545f4c49515549444954595f4d495f8201527f4e54454400000000000000000000000000000000000000000000000000000000602082015250565b5f6133bc602483612bed565b91506133c782613362565b604082019050919050565b5f6020820190508181035f8301526133e9816133b0565b9050919050565b7f4350414d4d3a20494e53554646494349454e545f4c49515549444954595f42555f8201527f524e454400000000000000000000000000000000000000000000000000000000602082015250565b5f61344a602483612bed565b9150613455826133f0565b604082019050919050565b5f6020820190508181035f8301526134778161343e565b9050919050565b5f6040820190506134915f83018561281d565b61349e60208301846127c5565b939250505056fea2646970667358221220eedb2cdb4fcf3ab6384704317b9eb07eeebd552ab3d5ef14e823e74448513b4664736f6c634300081e0033\n";

    public static final String FUNC_ADMIN_ROLE = "ADMIN_ROLE";

    public static final String FUNC_DEFAULT_ADMIN_ROLE = "DEFAULT_ADMIN_ROLE";

    public static final String FUNC_FEE_DENOMINATOR = "FEE_DENOMINATOR";

    public static final String FUNC_FEE_MANAGER_ROLE = "FEE_MANAGER_ROLE";

    public static final String FUNC_ORACLE_ROLE = "ORACLE_ROLE";

    public static final String FUNC_ADDLIQUIDITY = "addLiquidity";

    public static final String FUNC_BALANCEOF = "balanceOf";

    public static final String FUNC_BLOCKTIMESTAMPLAST = "blockTimestampLast";

    public static final String FUNC_COLLECTPROTOCOLFEES = "collectProtocolFees";

    public static final String FUNC_FEECOLLECTOR = "feeCollector";

    public static final String FUNC_GETPRICES = "getPrices";

    public static final String FUNC_GETROLEADMIN = "getRoleAdmin";

    public static final String FUNC_GRANTROLE = "grantRole";

    public static final String FUNC_HASROLE = "hasRole";

    public static final String FUNC_PAUSE = "pause";

    public static final String FUNC_PAUSED = "paused";

    public static final String FUNC_PRICE0CUMULATIVE = "price0Cumulative";

    public static final String FUNC_PRICE1CUMULATIVE = "price1Cumulative";

    public static final String FUNC_PROTOCOLFEE = "protocolFee";

    public static final String FUNC_PROTOCOLFEES0 = "protocolFees0";

    public static final String FUNC_PROTOCOLFEES1 = "protocolFees1";

    public static final String FUNC_REMOVELIQUIDITY = "removeLiquidity";

    public static final String FUNC_RENOUNCEROLE = "renounceRole";

    public static final String FUNC_RESERVE0 = "reserve0";

    public static final String FUNC_RESERVE1 = "reserve1";

    public static final String FUNC_REVOKEROLE = "revokeRole";

    public static final String FUNC_SETFEECOLLECTOR = "setFeeCollector";

    public static final String FUNC_SETPROTOCOLFEE = "setProtocolFee";

    public static final String FUNC_SETSWAPFEE = "setSwapFee";

    public static final String FUNC_SUPPORTSINTERFACE = "supportsInterface";

    public static final String FUNC_SWAPFEE = "swapFee";

    public static final String FUNC_SWAPTOKEN0FORTOKEN1 = "swapToken0ForToken1";

    public static final String FUNC_SWAPTOKEN1FORTOKEN0 = "swapToken1ForToken0";

    public static final String FUNC_TOKEN0 = "token0";

    public static final String FUNC_TOKEN1 = "token1";

    public static final String FUNC_TOTALSUPPLY = "totalSupply";

    public static final String FUNC_UNPAUSE = "unpause";

    public static final Event BURN_EVENT = new Event("Burn", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event FEECOLLECTORUPDATE_EVENT = new Event("FeeCollectorUpdate", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}));
    ;

    public static final Event FEEUPDATE_EVENT = new Event("FeeUpdate", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event MINT_EVENT = new Event("Mint", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event PAUSED_EVENT = new Event("Paused", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final Event PROTOCOLFEEUPDATE_EVENT = new Event("ProtocolFeeUpdate", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event ROLEADMINCHANGED_EVENT = new Event("RoleAdminChanged", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>(true) {}, new TypeReference<Bytes32>(true) {}, new TypeReference<Bytes32>(true) {}));
    ;

    public static final Event ROLEGRANTED_EVENT = new Event("RoleGranted", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event ROLEREVOKED_EVENT = new Event("RoleRevoked", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event SWAP_EVENT = new Event("Swap", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event SYNC_EVENT = new Event("Sync", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event UNPAUSED_EVENT = new Event("Unpaused", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    @Deprecated
    protected CPAMM(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected CPAMM(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected CPAMM(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected CPAMM(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public RemoteFunctionCall<byte[]> ADMIN_ROLE() {
        final Function function = new Function(FUNC_ADMIN_ROLE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<byte[]> DEFAULT_ADMIN_ROLE() {
        final Function function = new Function(FUNC_DEFAULT_ADMIN_ROLE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<BigInteger> FEE_DENOMINATOR() {
        final Function function = new Function(FUNC_FEE_DENOMINATOR, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<byte[]> FEE_MANAGER_ROLE() {
        final Function function = new Function(FUNC_FEE_MANAGER_ROLE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<byte[]> ORACLE_ROLE() {
        final Function function = new Function(FUNC_ORACLE_ROLE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<TransactionReceipt> addLiquidity(BigInteger amount0Desired, BigInteger amount1Desired, BigInteger amount0Min, BigInteger amount1Min, String to, BigInteger deadline) {
        final Function function = new Function(
                FUNC_ADDLIQUIDITY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(amount0Desired), 
                new org.web3j.abi.datatypes.generated.Uint256(amount1Desired), 
                new org.web3j.abi.datatypes.generated.Uint256(amount0Min), 
                new org.web3j.abi.datatypes.generated.Uint256(amount1Min), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(deadline)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> balanceOf(String param0) {
        final Function function = new Function(FUNC_BALANCEOF, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, param0)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> blockTimestampLast() {
        final Function function = new Function(FUNC_BLOCKTIMESTAMPLAST, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint32>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> collectProtocolFees() {
        final Function function = new Function(
                FUNC_COLLECTPROTOCOLFEES, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<String> feeCollector() {
        final Function function = new Function(FUNC_FEECOLLECTOR, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>> getPrices() {
        final Function function = new Function(FUNC_GETPRICES, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
        return new RemoteFunctionCall<Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>>(function,
                new Callable<Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>>() {
                    @Override
                    public Tuple4<BigInteger, BigInteger, BigInteger, BigInteger> call() throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>(
                                (BigInteger) results.get(0).getValue(), 
                                (BigInteger) results.get(1).getValue(), 
                                (BigInteger) results.get(2).getValue(), 
                                (BigInteger) results.get(3).getValue());
                    }
                });
    }

    public RemoteFunctionCall<byte[]> getRoleAdmin(byte[] role) {
        final Function function = new Function(FUNC_GETROLEADMIN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(role)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<TransactionReceipt> grantRole(byte[] role, String account) {
        final Function function = new Function(
                FUNC_GRANTROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(role), 
                new org.web3j.abi.datatypes.Address(160, account)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Boolean> hasRole(byte[] role, String account) {
        final Function function = new Function(FUNC_HASROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(role), 
                new org.web3j.abi.datatypes.Address(160, account)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<TransactionReceipt> pause() {
        final Function function = new Function(
                FUNC_PAUSE, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Boolean> paused() {
        final Function function = new Function(FUNC_PAUSED, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<BigInteger> price0Cumulative() {
        final Function function = new Function(FUNC_PRICE0CUMULATIVE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> price1Cumulative() {
        final Function function = new Function(FUNC_PRICE1CUMULATIVE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> protocolFee() {
        final Function function = new Function(FUNC_PROTOCOLFEE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> protocolFees0() {
        final Function function = new Function(FUNC_PROTOCOLFEES0, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> protocolFees1() {
        final Function function = new Function(FUNC_PROTOCOLFEES1, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> removeLiquidity(BigInteger liquidity, BigInteger amount0Min, BigInteger amount1Min, String to, BigInteger deadline) {
        final Function function = new Function(
                FUNC_REMOVELIQUIDITY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(liquidity), 
                new org.web3j.abi.datatypes.generated.Uint256(amount0Min), 
                new org.web3j.abi.datatypes.generated.Uint256(amount1Min), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(deadline)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> renounceRole(byte[] role, String callerConfirmation) {
        final Function function = new Function(
                FUNC_RENOUNCEROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(role), 
                new org.web3j.abi.datatypes.Address(160, callerConfirmation)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> reserve0() {
        final Function function = new Function(FUNC_RESERVE0, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> reserve1() {
        final Function function = new Function(FUNC_RESERVE1, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> revokeRole(byte[] role, String account) {
        final Function function = new Function(
                FUNC_REVOKEROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(role), 
                new org.web3j.abi.datatypes.Address(160, account)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setFeeCollector(String newCollector) {
        final Function function = new Function(
                FUNC_SETFEECOLLECTOR, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, newCollector)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setProtocolFee(BigInteger newProtocolFee) {
        final Function function = new Function(
                FUNC_SETPROTOCOLFEE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(newProtocolFee)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setSwapFee(BigInteger newSwapFee) {
        final Function function = new Function(
                FUNC_SETSWAPFEE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(newSwapFee)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Boolean> supportsInterface(byte[] interfaceId) {
        final Function function = new Function(FUNC_SUPPORTSINTERFACE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes4(interfaceId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<BigInteger> swapFee() {
        final Function function = new Function(FUNC_SWAPFEE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> swapToken0ForToken1(BigInteger amountIn, BigInteger amountOutMin, String to, BigInteger deadline) {
        final Function function = new Function(
                FUNC_SWAPTOKEN0FORTOKEN1, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(amountIn), 
                new org.web3j.abi.datatypes.generated.Uint256(amountOutMin), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(deadline)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> swapToken1ForToken0(BigInteger amountIn, BigInteger amountOutMin, String to, BigInteger deadline) {
        final Function function = new Function(
                FUNC_SWAPTOKEN1FORTOKEN0, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(amountIn), 
                new org.web3j.abi.datatypes.generated.Uint256(amountOutMin), 
                new org.web3j.abi.datatypes.Address(160, to), 
                new org.web3j.abi.datatypes.generated.Uint256(deadline)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<String> token0() {
        final Function function = new Function(FUNC_TOKEN0, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<String> token1() {
        final Function function = new Function(FUNC_TOKEN1, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<BigInteger> totalSupply() {
        final Function function = new Function(FUNC_TOTALSUPPLY, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> unpause() {
        final Function function = new Function(
                FUNC_UNPAUSE, 
                Arrays.<Type>asList(), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

//    public static List<BurnEventResponse> getBurnEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(BURN_EVENT, transactionReceipt);
//        ArrayList<BurnEventResponse> responses = new ArrayList<BurnEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            BurnEventResponse typedResponse = new BurnEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.sender = (String) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.amount0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.amount1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static BurnEventResponse getBurnEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(BURN_EVENT, log);
        BurnEventResponse typedResponse = new BurnEventResponse();
        typedResponse.log = log;
        typedResponse.sender = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.amount0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.amount1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<BurnEventResponse> burnEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getBurnEventFromLog(log));
    }

    public Flowable<BurnEventResponse> burnEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(BURN_EVENT));
        return burnEventFlowable(filter);
    }

//    public static List<FeeCollectorUpdateEventResponse> getFeeCollectorUpdateEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(FEECOLLECTORUPDATE_EVENT, transactionReceipt);
//        ArrayList<FeeCollectorUpdateEventResponse> responses = new ArrayList<FeeCollectorUpdateEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            FeeCollectorUpdateEventResponse typedResponse = new FeeCollectorUpdateEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.oldCollector = (String) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.newCollector = (String) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static FeeCollectorUpdateEventResponse getFeeCollectorUpdateEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FEECOLLECTORUPDATE_EVENT, log);
        FeeCollectorUpdateEventResponse typedResponse = new FeeCollectorUpdateEventResponse();
        typedResponse.log = log;
        typedResponse.oldCollector = (String) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.newCollector = (String) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<FeeCollectorUpdateEventResponse> feeCollectorUpdateEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getFeeCollectorUpdateEventFromLog(log));
    }

    public Flowable<FeeCollectorUpdateEventResponse> feeCollectorUpdateEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(FEECOLLECTORUPDATE_EVENT));
        return feeCollectorUpdateEventFlowable(filter);
    }

//    public static List<FeeUpdateEventResponse> getFeeUpdateEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(FEEUPDATE_EVENT, transactionReceipt);
//        ArrayList<FeeUpdateEventResponse> responses = new ArrayList<FeeUpdateEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            FeeUpdateEventResponse typedResponse = new FeeUpdateEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.oldSwapFee = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.newSwapFee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static FeeUpdateEventResponse getFeeUpdateEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(FEEUPDATE_EVENT, log);
        FeeUpdateEventResponse typedResponse = new FeeUpdateEventResponse();
        typedResponse.log = log;
        typedResponse.oldSwapFee = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.newSwapFee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<FeeUpdateEventResponse> feeUpdateEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getFeeUpdateEventFromLog(log));
    }

    public Flowable<FeeUpdateEventResponse> feeUpdateEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(FEEUPDATE_EVENT));
        return feeUpdateEventFlowable(filter);
    }

//    public static List<MintEventResponse> getMintEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(MINT_EVENT, transactionReceipt);
//        ArrayList<MintEventResponse> responses = new ArrayList<MintEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            MintEventResponse typedResponse = new MintEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.sender = (String) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.amount0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.amount1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static MintEventResponse getMintEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(MINT_EVENT, log);
        MintEventResponse typedResponse = new MintEventResponse();
        typedResponse.log = log;
        typedResponse.sender = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.amount0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.amount1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<MintEventResponse> mintEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getMintEventFromLog(log));
    }

    public Flowable<MintEventResponse> mintEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(MINT_EVENT));
        return mintEventFlowable(filter);
    }

//    public static List<PausedEventResponse> getPausedEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(PAUSED_EVENT, transactionReceipt);
//        ArrayList<PausedEventResponse> responses = new ArrayList<PausedEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            PausedEventResponse typedResponse = new PausedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static PausedEventResponse getPausedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAUSED_EVENT, log);
        PausedEventResponse typedResponse = new PausedEventResponse();
        typedResponse.log = log;
        typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<PausedEventResponse> pausedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getPausedEventFromLog(log));
    }

    public Flowable<PausedEventResponse> pausedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(PAUSED_EVENT));
        return pausedEventFlowable(filter);
    }

//    public static List<ProtocolFeeUpdateEventResponse> getProtocolFeeUpdateEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(PROTOCOLFEEUPDATE_EVENT, transactionReceipt);
//        ArrayList<ProtocolFeeUpdateEventResponse> responses = new ArrayList<ProtocolFeeUpdateEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            ProtocolFeeUpdateEventResponse typedResponse = new ProtocolFeeUpdateEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.oldProtocolFee = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.newProtocolFee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static ProtocolFeeUpdateEventResponse getProtocolFeeUpdateEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PROTOCOLFEEUPDATE_EVENT, log);
        ProtocolFeeUpdateEventResponse typedResponse = new ProtocolFeeUpdateEventResponse();
        typedResponse.log = log;
        typedResponse.oldProtocolFee = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.newProtocolFee = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<ProtocolFeeUpdateEventResponse> protocolFeeUpdateEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getProtocolFeeUpdateEventFromLog(log));
    }

    public Flowable<ProtocolFeeUpdateEventResponse> protocolFeeUpdateEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(PROTOCOLFEEUPDATE_EVENT));
        return protocolFeeUpdateEventFlowable(filter);
    }

//    public static List<RoleAdminChangedEventResponse> getRoleAdminChangedEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, transactionReceipt);
//        ArrayList<RoleAdminChangedEventResponse> responses = new ArrayList<RoleAdminChangedEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.previousAdminRole = (byte[]) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.newAdminRole = (byte[]) eventValues.getIndexedValues().get(2).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static RoleAdminChangedEventResponse getRoleAdminChangedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, log);
        RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse();
        typedResponse.log = log;
        typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.previousAdminRole = (byte[]) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.newAdminRole = (byte[]) eventValues.getIndexedValues().get(2).getValue();
        return typedResponse;
    }

    public Flowable<RoleAdminChangedEventResponse> roleAdminChangedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleAdminChangedEventFromLog(log));
    }

    public Flowable<RoleAdminChangedEventResponse> roleAdminChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEADMINCHANGED_EVENT));
        return roleAdminChangedEventFlowable(filter);
    }

//    public static List<RoleGrantedEventResponse> getRoleGrantedEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, transactionReceipt);
//        ArrayList<RoleGrantedEventResponse> responses = new ArrayList<RoleGrantedEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static RoleGrantedEventResponse getRoleGrantedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, log);
        RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse();
        typedResponse.log = log;
        typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue();
        return typedResponse;
    }

    public Flowable<RoleGrantedEventResponse> roleGrantedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleGrantedEventFromLog(log));
    }

    public Flowable<RoleGrantedEventResponse> roleGrantedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEGRANTED_EVENT));
        return roleGrantedEventFlowable(filter);
    }

//    public static List<RoleRevokedEventResponse> getRoleRevokedEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, transactionReceipt);
//        ArrayList<RoleRevokedEventResponse> responses = new ArrayList<RoleRevokedEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static RoleRevokedEventResponse getRoleRevokedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, log);
        RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse();
        typedResponse.log = log;
        typedResponse.role = (byte[]) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.sender = (String) eventValues.getIndexedValues().get(2).getValue();
        return typedResponse;
    }

    public Flowable<RoleRevokedEventResponse> roleRevokedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleRevokedEventFromLog(log));
    }

    public Flowable<RoleRevokedEventResponse> roleRevokedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEREVOKED_EVENT));
        return roleRevokedEventFlowable(filter);
    }

//    public static List<SwapEventResponse> getSwapEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(SWAP_EVENT, transactionReceipt);
//        ArrayList<SwapEventResponse> responses = new ArrayList<SwapEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            SwapEventResponse typedResponse = new SwapEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.sender = (String) eventValues.getIndexedValues().get(0).getValue();
//            typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();
//            typedResponse.amount0In = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.amount1In = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            typedResponse.amount0Out = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
//            typedResponse.amount1Out = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static SwapEventResponse getSwapEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SWAP_EVENT, log);
        SwapEventResponse typedResponse = new SwapEventResponse();
        typedResponse.log = log;
        typedResponse.sender = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.amount0In = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.amount1In = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.amount0Out = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.amount1Out = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
        return typedResponse;
    }

    public Flowable<SwapEventResponse> swapEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getSwapEventFromLog(log));
    }

    public Flowable<SwapEventResponse> swapEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(SWAP_EVENT));
        return swapEventFlowable(filter);
    }

//    public static List<SyncEventResponse> getSyncEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(SYNC_EVENT, transactionReceipt);
//        ArrayList<SyncEventResponse> responses = new ArrayList<SyncEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            SyncEventResponse typedResponse = new SyncEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.reserve0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
//            typedResponse.reserve1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static SyncEventResponse getSyncEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(SYNC_EVENT, log);
        SyncEventResponse typedResponse = new SyncEventResponse();
        typedResponse.log = log;
        typedResponse.reserve0 = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.reserve1 = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<SyncEventResponse> syncEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getSyncEventFromLog(log));
    }

    public Flowable<SyncEventResponse> syncEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(SYNC_EVENT));
        return syncEventFlowable(filter);
    }
//
//    public static List<UnpausedEventResponse> getUnpausedEvents(TransactionReceipt transactionReceipt) {
//        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(UNPAUSED_EVENT, transactionReceipt);
//        ArrayList<UnpausedEventResponse> responses = new ArrayList<UnpausedEventResponse>(valueList.size());
//        for (Contract.EventValuesWithLog eventValues : valueList) {
//            UnpausedEventResponse typedResponse = new UnpausedEventResponse();
//            typedResponse.log = eventValues.getLog();
//            typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
//            responses.add(typedResponse);
//        }
//        return responses;
//    }

    public static UnpausedEventResponse getUnpausedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNPAUSED_EVENT, log);
        UnpausedEventResponse typedResponse = new UnpausedEventResponse();
        typedResponse.log = log;
        typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<UnpausedEventResponse> unpausedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getUnpausedEventFromLog(log));
    }

    public Flowable<UnpausedEventResponse> unpausedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(UNPAUSED_EVENT));
        return unpausedEventFlowable(filter);
    }

    @Deprecated
    public static CPAMM load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new CPAMM(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static CPAMM load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new CPAMM(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static CPAMM load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return new CPAMM(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static CPAMM load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new CPAMM(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<CPAMM> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider, String _token0, String _token1, String _admin) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, _token0), 
                new org.web3j.abi.datatypes.Address(160, _token1), 
                new org.web3j.abi.datatypes.Address(160, _admin)));
        return deployRemoteCall(CPAMM.class, web3j, credentials, contractGasProvider, BINARY, encodedConstructor);
    }

    public static RemoteCall<CPAMM> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider, String _token0, String _token1, String _admin) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, _token0), 
                new org.web3j.abi.datatypes.Address(160, _token1), 
                new org.web3j.abi.datatypes.Address(160, _admin)));
        return deployRemoteCall(CPAMM.class, web3j, transactionManager, contractGasProvider, BINARY, encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<CPAMM> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, String _token0, String _token1, String _admin) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, _token0), 
                new org.web3j.abi.datatypes.Address(160, _token1), 
                new org.web3j.abi.datatypes.Address(160, _admin)));
        return deployRemoteCall(CPAMM.class, web3j, credentials, gasPrice, gasLimit, BINARY, encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<CPAMM> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit, String _token0, String _token1, String _admin) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, _token0), 
                new org.web3j.abi.datatypes.Address(160, _token1), 
                new org.web3j.abi.datatypes.Address(160, _admin)));
        return deployRemoteCall(CPAMM.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, encodedConstructor);
    }

    public static class BurnEventResponse extends BaseEventResponse {
        public String sender;

        public String to;

        public BigInteger amount0;

        public BigInteger amount1;
    }

    public static class FeeCollectorUpdateEventResponse extends BaseEventResponse {
        public String oldCollector;

        public String newCollector;
    }

    public static class FeeUpdateEventResponse extends BaseEventResponse {
        public BigInteger oldSwapFee;

        public BigInteger newSwapFee;
    }

    public static class MintEventResponse extends BaseEventResponse {
        public String sender;

        public BigInteger amount0;

        public BigInteger amount1;
    }

    public static class PausedEventResponse extends BaseEventResponse {
        public String account;
    }

    public static class ProtocolFeeUpdateEventResponse extends BaseEventResponse {
        public BigInteger oldProtocolFee;

        public BigInteger newProtocolFee;
    }

    public static class RoleAdminChangedEventResponse extends BaseEventResponse {
        public byte[] role;

        public byte[] previousAdminRole;

        public byte[] newAdminRole;
    }

    public static class RoleGrantedEventResponse extends BaseEventResponse {
        public byte[] role;

        public String account;

        public String sender;
    }

    public static class RoleRevokedEventResponse extends BaseEventResponse {
        public byte[] role;

        public String account;

        public String sender;
    }

    public static class SwapEventResponse extends BaseEventResponse {
        public String sender;

        public String to;

        public BigInteger amount0In;

        public BigInteger amount1In;

        public BigInteger amount0Out;

        public BigInteger amount1Out;
    }

    public static class SyncEventResponse extends BaseEventResponse {
        public BigInteger reserve0;

        public BigInteger reserve1;
    }

    public static class UnpausedEventResponse extends BaseEventResponse {
        public String account;
    }
}
